<!-- File: /app/View/Posts/index.ctp -->

<h1>Blog Users</h1>
<table>
    <tr>
        <th>Id</th>
        <th>Nom d'utilisateur</th>
		<th>Action</th>
        <th>Role</th>
		<th>Email</th>
		<th>Prenom</th>
		<th>Created</th>
    </tr>

    <!-- Here is where we loop through our $users array, printing out user info -->

    <?php foreach ($users as $user): ?>
    <tr>
        <td><?php echo $user['User']['id']; ?></td>
        <td><?php echo $user['User']['username']; ?></td>
		<td><?php echo $this->Form->postLink('Delete',array('action' => 'delete', $user['User']['id']),array('confirm' => 'Etes-vous sûr ?'));?>
		<?php echo $this->Html->link('Edit', array('action' => 'edit', $user['User']['id'])); ?></td>
        <td><?php echo $user['User']['role']; ?></td>
		<td><?php echo $user['User']['email']; ?></td>
		<td><?php echo $user['User']['firstname']; ?></td>
		<td><?php echo $user['User']['created']; ?></td>
    </tr>
    <?php endforeach; ?>
    <?php unset($user); ?>
</table>